﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DAL
{
    using DAL.Entities;

    public class ThongkedanhsachnhanvienDAL : BaseDAL, UTL.IBaseDAL 
    {
        public int Count()
        {
            throw new NotImplementedException();
        }

        public DataTable Select()
        {
            throw new NotImplementedException();
        }

        public DataTable Select(object obj)
        {
            throw new NotImplementedException();
        }

        public object GetByKey(object key)
        {
            throw new NotImplementedException();
        }

        public bool Delete(string id)
        {
            throw new NotImplementedException();
        }

        public bool Insert(object obj)
        {
            throw new NotImplementedException();
        }

        public bool Update(object obj)
        {
            throw new NotImplementedException();
        }

        public DataTable Search(string name)
        {
            throw new NotImplementedException();
        }
        public DataTable Thongkeddanhsachnhanvien()

        {
            string sql = @"select a.MA_NV,a.TEN_NV  ,(Case when a.GIOITINH_NV = 1 then 'Nam' else N'Nữ' end) as sex ,a.NAMSINH_NV ,a.DIACHI_NV,a.SDT_NV,a.TAIKHOAN,a.MATKHAU,b.MACD ,c.MAHV
                            from NHANVIEN a join CHUCDANH b on a.MACD = b.MACD
                            join HOCVI c on a.MAHV = c.MAHV";
            //sql = string.Format(sql);
            return ExecuteQuery(sql);
        }
        //public DataTable select_trangthaikham()
        //{
        //    string sql = @"select distinct a.matrangthai as id,tentrangthai as ten from trangthaikham a join phieukham b on a.matrangthai=b.matrangthai";
        //    return ExecuteQuery(sql);
        //}
      
        /// <summary>
        /// lay ...
        /// </summary>
        /// <returns></returns>
     

        public bool deleteobj(object obj)
        {
            throw new NotImplementedException();
        }
    }
}
